<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="demo"></p>
    <script>
        //  Number转成数字类型，NaN也是数字类型，代表非数字
        let num=123
        // console.log(Number(num));
        // console.log(Number('pingk'));
        // let Num=+prompt("请输入年薪：")
        // console.log(Num)

        //  parseInt 整数型，parseFloat 浮点型
        console.log(parseInt('3.9px'));  //3
        console.log(parseInt(3.233));       //3
        console.log(parseInt("3.4"+'szhangsan'));       //3
        console.log(parseInt('szhang12san'));       //NaN
        console.log("<!-- ----------------------------------------------------------------------- -->");

        console.log(parseFloat(3.955555));      //3.955555
        console.log(parseFloat('3.9px'));       //3.9
        console.log(parseFloat("3777.554wrer"+'szhangsan'));        //3777.554
        console.log(parseFloat('szh9090angsan'));       //NaN
        
    </script>
</body>
</html>